import Jsr from "../../../main/js/com/1110111011101110/jsr/Jsr";
const path = require('path');
const fs = require('fs');

class  JsrTest{
    constructor(){
        this.jsr = new Jsr();

        let data=  "xxxxxxxxxxxxxxxxxxxxxxxxxx";
        this.jsr.pushFile(data,"xxxx","dir")

        this. buff = this.jsr.findAllBuff();

        let xxx= this.jsr.findFile("xxxx")

        debugger;
    }



}

let xx=new JsrTest();



let buffList= xx.buff;
fs.open("xxx.jsr", 'w', '0666' , function(err, fd){
    if (err) throw err;
    if(err) {
        console.error(err);
        return;
    } else {
        for(let i=0;i<buffList.length;i++){
            let buffer =buffList[i];
            //写入'入文件'三个字
            fs.writeSync(fd,buffer, function (err) {
                if(err) {
                    console.log('写入文件失败');
                    console.error(err);
                    return;
                }
            });
        }


    }

});